var Configer = (function(){
	var dataTableConfig = {
		initComplete: function () {
		    $("#dataTable_filter").find("input").attr("placeholder","手机号码查询");
		},
		"pagingType":   "full_numbers",
		"sLoadingRecords": "正在加载数据...",
		"sZeroRecords": "暂无数据",
		"stateSave": true,
		"searching": true,
        "aoColumnDefs": [{ 
            "bSortable": false, 
            "aTargets": [5] 
        }],
		"language": {
			"processing": "玩命加载中...",
			"lengthMenu": "_MENU_ ",
			"zeroRecords": "没有匹配结果",
			"info": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
			"infoEmpty": "显示第 0 至 0 项结果，共 0 项",
			"infoFiltered": "(由 _MAX_ 项结果过滤)",
			"infoPostFix": "",
			"search":"",
			"url": "",
			"paginate": {
				"first":    "首页",
				"previous": "上一页",
				"next":     "下一页",
				"last":     "末页"
			}
	    }
	}
	return {
		dataTableConfig : dataTableConfig
	}
})();

var Common = (function(){

})();

var System = (function(){

	var metrialHandle = function(){
		$.material.init();
	};

	var sliderToggleHandle = function(){
		var btnToggle = $(".slider-toggle"),
			sliderBar = $(".sliderbar"),
			mainContent = $(".main");
		btnToggle.on("click", function(){
			  var sidebarState = sliderBar.attr('data-state');
		      if(sidebarState == "open"){
		      	sliderBar.css({ "left":"-150px" });
		      	mainContent.css({ "margin-left":"20px"});
		        sliderBar.attr('data-state', 'closed')
		      }
		      else{
		      	sliderBar.css({"left":"0px"});
		      	mainContent.css({"margin-left":"170px"});
		        sliderBar.attr('data-state', 'open')
		     }
		});
	};

	var dataTablesHandle = function(){
		var dataTable = $("#dataTable");
		if (dataTable && dataTable.length) {
			var table = dataTable.dataTable(Configer.dataTableConfig);
		};
	};
	
	return {
		init : function(){
			metrialHandle();
			sliderToggleHandle();
			dataTablesHandle();
		}
	}
})();

$(function(){

	

	System.init();


});